package com.zz.entity;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import lombok.Data;
@Data
@Entity
@Table(name="students")
public class Students implements Serializable{
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
private Integer id;
	@Column
private String cardno;
	@Column
private String name;
	@Column
private String sex;
	@Column
private String status;
	@Column
private String remark;
	@Column
private Integer stuno;
	
	
	  @ManyToOne(targetEntity=Memberships.class,cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	  @JoinColumn(name="membershipid",referencedColumnName="id") 
	  private Memberships memberships;
	 
	 
  
  
  
}
